<template name="myhead">
	<view class="headMain">
		<view class="statusBar"></view>
		<view class="head">
			<view class="headLeft">
				<block v-if="left=='1'">
					<view @tap="lastBtn">
						<image src="../../static/lastBg.png" mode="aspectFit"></image>
					</view>
				</block>
				<block v-if="home=='1'">
					<view @tap="homeBtn">
						<image src="../../static/homeBg.png" mode="aspectFit"></image>
					</view>
				</block>
			</view>
			<view>{{txt}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "myhead",
		data() {
			return {
				
			};
		},
		props: {
			txt: {
				type: String,
				default: ''
			},
			home: {
				type: String,
				default: '0'
			},
			left: {
				type: String,
				default: '0'
			}
		},
		//组件生命周期
		created:function(e){
			
		},
		methods: {
			lastBtn:function(){
				uni.navigateBack({
					delta: 1
				})
			},
			homeBtn:function(){
				uni.switchTab({
					url:"/pages/home/home"
				})
			}
		}
	}
</script>

<style>
	.headMain{
		background-image: linear-gradient(45deg, #24EBA9, #10C7B2);
	}
	.statusBar{
		height: 6vw;
	}
	.head{
		width: 100%;
		height: 10vw;
		position: relative;
		line-height: 10vw;
		color: #FFFFFF;
	}
	.head image{
		width: 50%;
		height: 50%;
	}
	.head>view{
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}
	.headLeft{
		font-size: 5vw;
		position: absolute;
	}
	.headLeft>view{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.headLeft>view:nth-child(1){
		width: 10vw;
		height: 10vw;
		text-align: center;
	}
	.headLeft>view:nth-child(2){
		width: 10vw;
		height: 10vw;
		text-align: center;
	}
</style>
